package com.cmwa.solution.business.product.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cmwa.solution.base.entity.Page;
import com.cmwa.solution.base.entity.SearchParam;
import com.cmwa.solution.business.product.dao.TreFeeTypeDao;
import com.cmwa.solution.business.product.entity.TreFeeDetailVo;
import com.cmwa.solution.business.product.entity.TreFeeTypeVo;
import com.cmwa.solution.business.product.service.TreFeeTypeService;
import com.cmwa.solution.utils.SessionUtils;

/**
 * 招商财富产品表业务实现层
 */
@Service
public class TreFeeTypeServiceImpl implements TreFeeTypeService {
	@Resource
	private TreFeeTypeDao treFeeTypeDao;

	@Override
	public List<TreFeeDetailVo> prdFeeInfoByCode(String prdCode) {
		return treFeeTypeDao.prdFeeInfoByCode(prdCode);
	}

	@Override
	public Page<TreFeeTypeVo> treFeeTypeListPage(SearchParam param) {
		List<TreFeeTypeVo> items = treFeeTypeDao.treFeeTypeListPage(param);
		return Page.create(items, param.getStart(), param.getLimit(), param.getTotal());
	}

	@Override
	public TreFeeTypeVo getTreFeeTypeByFeeCode(String feeCode) {
		return treFeeTypeDao.getTreFeeTypeByFeeCode(feeCode);
	}

	@Override
	public void insertTreFeeType(TreFeeTypeVo treFeeTypeVo) {
		String createId = SessionUtils.getEmployee().getID();
		treFeeTypeVo.setCreateId(createId);
		treFeeTypeDao.insertTreFeeType(treFeeTypeVo);
	}

	@Override
	public void updateTreFeeType(TreFeeTypeVo treFeeTypeVo) {
		String modifyId = SessionUtils.getEmployee().getID();
		treFeeTypeVo.setModifyId(modifyId);
		treFeeTypeDao.updateTreFeeType(treFeeTypeVo);
	}

	@Override
	public int deleteTreFeeType(String feeCode) {
		String modifyId = SessionUtils.getEmployee().getID();
		return treFeeTypeDao.deleteTreFeeType(modifyId ,feeCode);
	}

	@Override
	public List<TreFeeTypeVo> treFeeTypeList() {
		return treFeeTypeDao.treFeeTypeList();
	}


}
